package com.whfc.iot.fse.crane.entity;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TwMsgFactory {
    private static Logger logger = LoggerFactory.getLogger(TwMsgFactory.class);

    public static TwMsg createTwMsg(int cmd) {
        TwMsg twMsg = null;
        switch (cmd) {
            case TwConst.TW_CMD_WORKCYCLEDATA:
                twMsg = new TwMsgWorkCycle();
                break;
            case TwConst.TW_CMD_REALDATA:
                twMsg = new TwMsgRealData();
                break;
            default:
                logger.info("无法解析的指令,cmd:{}", cmd);
                break;
        }
        return twMsg;
    }

    public static void main(String[] args) {
        System.out.println(0x3D); // 61
        System.out.println(0x0C); // 12
    }
}
